package com.zlx.xBiaoShop.mapper;

import com.zlx.xBiaoShop.entity.SysUserGoods;
import org.apache.ibatis.annotations.*;

@Mapper
public interface SysUserGoodsMapper {
    @Select("SELECT * FROM `sys_user_goods` WHERE user_id=#{userId} AND goods_id=#{goodsId}")
    SysUserGoods findByUserIdAndGoodsId(@Param("userId") Integer userId,@Param("goodsId") Integer goodsId);

    @Insert("INSERT INTO `xbiao_shop`.`sys_user_goods`(`user_id`, `goods_id`) VALUES (#{userId}, #{goodsId})")
    void insert(@Param("userId") Integer userId,@Param("goodsId") Integer goodsId);

    @Delete("delete FROM `sys_user_goods` WHERE user_id=#{userId} AND goods_id=#{goodsId}")
    void delete(@Param("userId") Integer userId,@Param("goodsId") Integer goodsId);
}
